<div id="preject">
    {switch $type}
    {case 1}
    <div id="user"><a  href="{:url('register')}?type=1" id="chocse">学生</a><a href="{:url('register')}?type=2">教工</a><a href="{:url('register')}?type=3">校外</a></div>
    <input type="hidden" name="type" value="1">
    <div class="item"></td><td><input type="number" name="stuid"  required onchange="getstuid(this)" placeholder="学号"></div>
    <div class="item"><input type="text" name="name" required onchange="getname(this)" placeholder="姓名"></div>
    <div class="item"><input type="password" name="psw"  id="psw"  required onchange="getpassword(this)" placeholder="密码"></div>
    <div class="item"><input type="password" required onchange="getpassword2(this)"  placeholder="确认密码"></div>
    <div class="item"><input type="email" name="email" required   placeholder="邮箱"></div>
    <div class="item"><input type="number" name="phone" required onchange="getphone(this)"  placeholder="联系方式"></div>
    <div class="item">
        <select style="width: 240px;height: 30px;" id="cho" required onchange="getgrade(this.value);">
            <option>选择系部</option>
            {foreach $xibu as $v}
            <option value="{$v.uid}">{$v.apartment}</option>
            {/foreach}
        </select>
        <input id="apartment"  name="apartment" type="hidden"/>
    </div>
    <div class="item">
        <select id="grade" style="width: 240px;height: 30px;" name="grade" required onchange="getclass(this.value);">
            <option>选择年级</option>
            {foreach name="grade" item="v"}
            <option value="{$v.grade}">{$v.grade}</option>
            {/foreach}
        </select>
    </div>

    <div class="item">
        <select id="class" style="width: 240px;height: 30px;" name="class" required>
            {/foreach}
        </select>
    </div>
    <div class="item"><input type="text" name="captcha" placeholder="验证码"></div>
    <div class="item"><img src="{:captcha_src()}"  id="img"  alt="captcha" /></div>
    <div class="item"><input  type="submit" value="登　录"  onclick="register()"></div>

    {/case}

    {case 2}
    <div id="user"><a  href="{:url('register')}?type=1" >学生</a><a href="{:url('register')}?type=2" id="chocse">教工</a><a href="{:url('register')}?type=3">校外</a></div>
    <input type="hidden" name="type" value="2">
    <div class="item"></td><td><input type="number" name="phone"  required onchange="getphone(this)" placeholder="号码"></div>
    <div class="item"><input type="text" name="name"  required onchange="getname(this)" placeholder="姓名"></div>
    <div class="item"><input type="password" name="psw" required  id="psw"   onchange="getpassword(this)" placeholder="密码"></div>
    <div class="item"><input type="password" required onchange="getpassword2(this)"  placeholder="确认密码"></div>
    <div class="item"><input type="email" name="email" required   placeholder="邮箱"></div>
    <div class="item"><input type="number" name="phone" required onchange="getphone(this)"  placeholder="联系方式"></div>
    <div class="item">
        <select style="width: 240px;height: 30px;"  id="cho" required onchange="getgrade(this.value);">
            <option>选择部门</option>
            {foreach name="apartment" item="v"}
            <option value="{$v.uid}">{$v.apartment}</option>
            {/foreach}
        </select>
        <input id="apartment"  name="apartment" type="hidden"/>
    </div>

    <div class="item"><input type="text" name="captcha"  placeholder="验证码"></div>
    <div class="item"><img src="{:captcha_src()}"  id="img"  alt="captcha" /></div>
    <div class="item"><input  type="submit" value="登　录"  onclick="register()"></div>

    {/case}

    {case 3}
    <div id="user"><a  href="{:url('register')}?type=1">学生</a><a href="{:url('register')}?type=2">教工</a><a href="{:url('register')}?type=3"  id="chocse">校外</a></div>
    <table>
        <input type="hidden" name="type" value="3">
        <div class="item"><input type="number" name="phone"  required onchange="getphone(this)" placeholder="号码"></div>
        <div class="item"><input type="text" name="name"  required onchange="getname(this)" placeholder="姓名"></div>
        <div class="item"><input type="password" name="psw"  id="psw"  required onchange="getpassword(this)" placeholder="密码"></div>
        <div class="item"><input type="password" required onchange="getpassword2(this)"  placeholder="确认密码"></div>
        <div class="item"><input type="email" name="email" required   placeholder="邮箱"></div>
        <div class="item"><input type="number" name="phone" required onchange="getphone(this)"  placeholder="联系方式"></div>
        <div class="item"><input  type="text"  name="apartment"  placeholder="单位"/></div>
        <div class="item"><input type="text" name="captcha"  placeholder="验证码"></div>
        <div class="item"><img src="{:captcha_src()}"  id="img"  alt="captcha" /></div>
        <div class="item"><input  type="submit" value="登　录"  onclick="register()"></div>
    </table>
    {/case}
    {/switch}
</div>